#include"chatserver.hpp"
#include"chatservice.hpp"
#include<signal.h>
#include<iostream>


void resetHandler(int){
    ChatService::instance()->reset();
    exit(0);
}


//项目启动项
using namespace std;
int main(){
    signal(SIGINT,resetHandler);
    EventLoop loop;
    InetAddress addr("127.0.0.1",6000);
    ChatServer server(&loop,addr,"ChatServer");
    server.start();
    loop.loop();//开启事件循环
    return 0;
}